package com.lagou.ipersistence.session;

import java.util.List;

/**
 * @author Yan Jiahong
 * Created 2020/11/8
 */
public interface SqlSession {
    <E> E selectOne(String statement);

    <E> E selectOne(String statement, Object parameter);

    <E> List<E> selectList(String statement);

    <E> List<E> selectList(String statement, Object parameter);
    
    <E> List<E> selectList(String statement, Object parameter, RowBounds rowBounds);

    int insert(String statement);

    int insert(String statement, Object parameter);

    int update(String statement);

    int update(String statement, Object parameter);

    int delete(String statement);

    int delete(String statement, Object parameter);

    /**
     * 为Mapper接口实现代理实现类
     * @param clazz Mapper类
     * @return Mapper接口的实现类对象
     */
    <T> T getMapper(Class<T> clazz);
    
    Configuration getConfiguration();

    void commit();
    
    void close();
}
